﻿using MotorLibrary.Model;
using MotorLibrary.Repository.DTO;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace MotorLibrary.Repository
{
    public interface IRepository<EntityType, DTOType>
        where EntityType: IEntity
        where DTOType: IDTO
    {
        DTOType Read(long id);
        IList<DTOType> List();
        DTOType Create(DTOType dto);
        DTOType Update(DTOType dto);
        DTOType Delete(long id);
        IList<DTOType> Filter(Expression<Func<EntityType, bool>> predicate);
    }
}
